<template>
  <!-- 左侧边栏 - 固定在页面左侧 -->
  <aside class="sidebar">
    <!-- 导航菜单 - 主要功能区域 -->
    <nav class="sidebar-nav">
      <!-- 发现菜单项 - 当前激活状态 -->
      <div class="nav-item active">
        <!-- 发现图标 - 使用图片替代SVG -->
        <img src="/src/assets/icons/home.png" alt="发现" class="nav-icon" />
        <!-- 菜单文字 -->
        <span class="nav-text">发现</span>
      </div>
      
      <!-- 发布菜单项 -->
      <div class="nav-item">
        <!-- 发布图标 -->
        <img src="/src/assets/icons/more.png" alt="发布" class="nav-icon" />
        <!-- 菜单文字 -->
        <span class="nav-text">发布</span>
      </div>
      
      <!-- 通知菜单项 -->
      <div class="nav-item">
        <!-- 通知图标 -->
        <img src="/src/assets/icons/inform.png" alt="通知" class="nav-icon" />
        <!-- 菜单文字 -->
        <span class="nav-text">通知</span>
      </div>
      
      <!-- 我菜单项 -->
      <div class="nav-item">
        <!-- 用户图标 -->
        <img src="/src/assets/icons/user.png" alt="我" class="nav-icon" />
        <!-- 菜单文字 -->
        <span class="nav-text">我</span>
      </div>
    </nav>
    
    <!-- 底部菜单区域 - 次要功能区域 -->
    <div class="sidebar-bottom">
      <!-- 更多菜单项 -->
      <div class="nav-item">
        <!-- 更多图标 -->
        <img src="/src/assets/icons/Announce.png" alt="更多" class="nav-icon" />
        <!-- 菜单文字 -->
        <span class="nav-text">更多</span>
      </div>
    </div>
  </aside>
</template>

<script setup>
// 这里可以添加导航逻辑
// 例如：处理菜单点击事件、路由跳转等
</script>

<style scoped>
/* 侧边栏样式 */
.sidebar {
  position: fixed;
  left: 0;
  top: 60px;
  width: 76px;
  height: calc(100vh - 60px);
  background: white;
  display: flex;
  flex-direction: column;
  z-index: 100;
  border-right: 1px solid var(--border-color);
  transition: all 0.3s ease;
}

/* 导航菜单样式 */
.sidebar-nav {
  flex: 1;
  padding: 20px 0 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* 导航项样式 */
.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 14px 0;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  color: #8a8a8a;
  position: relative;
  border-radius: 0 16px 16px 0;
  width: 100%;
}

/* 导航项悬停效果 */
.nav-item:hover {
  background: rgba(255, 36, 66, 0.03);
  color: var(--primary-color);
  transform: translateX(2px);
}

/* 激活状态的导航项 */
.nav-item.active {
  color: var(--primary-color);
  background: linear-gradient(90deg, rgba(255, 36, 66, 0.1), transparent);
  font-weight: 600;
}

/* 激活状态的装饰条 */
.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 32px;
  background: var(--primary-color);
  border-radius: 0 4px 4px 0;
}

/* 移除导航图标容器的圆形背景 */
.nav-item::after {
  display: none;
}

/* 导航图标样式 */
.nav-icon {
  width: 24px;
  height: 24px;
  object-fit: contain;
  margin-bottom: 8px;
  transition: all 0.3s ease;
  position: relative;
  z-index: 1;
}

/* 激活状态的图标样式 */
.nav-item.active .nav-icon {
  filter: drop-shadow(0 0 6px rgba(255, 36, 66, 0.3));
  transform: scale(1.05);
}

/* 导航文字样式 */
.nav-text {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
  position: relative;
  z-index: 1;
}

/* 底部菜单区域样式 */
.sidebar-bottom {
  padding: 16px 0;
  margin-top: auto;
  border-top: 1px solid var(--border-color);
}

/* 更多菜单项特殊样式 */
.sidebar-bottom .nav-item {
  opacity: 0.8;
}

.sidebar-bottom .nav-item:hover {
  opacity: 1;
}

/* 响应式设计 */
@media (max-width: 1200px) {
  .sidebar {
    width: 70px;
  }
  
  .nav-icon {
    width: 22px;
    height: 22px;
  }
  
  .nav-text {
    font-size: 10px;
  }
}

@media (max-width: 768px) {
  .sidebar {
    width: 50px;
    top: 50px;
    height: calc(100vh - 50px);
  }
  
  .sidebar-nav {
    padding: 16px 0 12px;
    gap: 4px;
  }
  
  .nav-item {
    padding: 14px 0;
  }
  
  .nav-icon {
    width: 20px;
    height: 20px;
    margin-bottom: 4px;
  }
  
  .nav-text {
    font-size: 9px;
  }
}

@media (max-width: 480px) {
  .sidebar {
    display: none;
  }
}
</style>